1. Field of the Invention
The invention relates to a method for managing a memory device, and more particularly to a method for optimizing read and write operations of a flash memory device.
2. Description of the Related Art
A flash memory or EEPROM (Electrically Erasable Programmable Read Only Memory) is a special type of nonvolatile memory capable of electrically erasing and programming data. In this context, these two terms, flash memory and EEPROM, are usually equivalent and interchangeable. Flash memory based storage devices have low power consumption and small size as compared to magnetic disc memory based devices. Thus, they are often used as storage devices for mobile computing devices such as digital cameras, mobile phones, or personal digital assistants (PDAs).
In magnetic disc drives, new data can be directly written over previous data bitwise or byte wise. However, in flash memories, a block needs to be erased before it is rewritten with new data. That is, the read and write operations of flash memories are based on pages or sectors, while the erase operation is based on blocks. Thus, an erase operation typically requires much more time than a write and a read operation. Furthermore, since a block's size is much larger than a page and a sector, the entire block needs to be erased even only a tiny portion of the block gets update.
Conventionally, a media management layer is used to improve the read and write operation performance by implementing mapping schemes. When data stored in a specific block requires modification, a free block (named a log block) may be used to store the modification records. In this manner, every time the data stored in a specific block requires modification, the new data is written into a corresponding log block to avoid erasing a whole block for the write operation. However, in the read operation, a process of visiting (i.e. reading or traversing) the data in a reverse order from the end of the log block is required to retrieve the latest data, which seriously degrades the reading speed due to a huge amount of unnecessary read operation during the reversely visiting.
Therefore, a novel memory device managing method for optimizing read and write operations of a flash memory device and greatly accelerating the read and write operations is highly required.